package de.koller.aframe.util.math.interpolation;

import de.koller.aframe.util.math.FunctionPreview;
import de.koller.aframe.util.math.IFunction;

public class LinearInterpolation {
	
	public static float linear( float x, float f0, float f1 ) {
		return (f1-f0)*x + f0;
	}
	
	public static void main( String[] args ) {
		FunctionPreview.dontscale( -.1f );
		FunctionPreview.showFunction( -.5f, 2f, new Test() );
	}
	
	private static class Test implements IFunction {

		@Override
		public float getValue( float x ) {
			return linear( x, .5f, .2f );
		}
		
	}
	
}
